<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  
    
      
    

    
  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|consolas:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="CSS," />








  <link rel="shortcut icon" type="image/x-icon" href="http://ofy7k3v4s.bkt.clouddn.com/mylogo.png?v=5.0.2" />






<meta name="description" content="&amp;#x6837;&amp;#x5F0F;&amp;#x8868;&amp;#x7684;&amp;#x4E66;&amp;#x5199;&amp;#x4F4D;&amp;#x7F6E;&amp;#x5199;&amp;#x5728; &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; &amp;#x4E2D;, &amp;#x6837;&amp;#x5F0F;&amp;#xFF1A;&amp;#x9009;&amp;#x62E9;&amp;#x5668;{&amp;#x5C5E;&amp;#x6027;:&amp;#x503C;;&amp;#x5C5E;">
<meta property="og:type" content="article">
<meta property="og:title" content="CSS样式表、CSS选择器">
<meta property="og:url" content="https://hongqinma.github.io/2013/09/10/CSS样式表、选择器-md/index.html">
<meta property="og:site_name" content="HongqinMa' Blog">
<meta property="og:description" content="&amp;#x6837;&amp;#x5F0F;&amp;#x8868;&amp;#x7684;&amp;#x4E66;&amp;#x5199;&amp;#x4F4D;&amp;#x7F6E;&amp;#x5199;&amp;#x5728; &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; &amp;#x4E2D;, &amp;#x6837;&amp;#x5F0F;&amp;#xFF1A;&amp;#x9009;&amp;#x62E9;&amp;#x5668;{&amp;#x5C5E;&amp;#x6027;:&amp;#x503C;;&amp;#x5C5E;">
<meta property="og:image" content="https://hongqinma.github.io/2013/09/10/CSS样式表、选择器-md/text-base.png">
<meta property="og:updated_time" content="2016-12-08T03:00:54.015Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CSS样式表、CSS选择器">
<meta name="twitter:description" content="&amp;#x6837;&amp;#x5F0F;&amp;#x8868;&amp;#x7684;&amp;#x4E66;&amp;#x5199;&amp;#x4F4D;&amp;#x7F6E;&amp;#x5199;&amp;#x5728; &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; &amp;#x4E2D;, &amp;#x6837;&amp;#x5F0F;&amp;#xFF1A;&amp;#x9009;&amp;#x62E9;&amp;#x5668;{&amp;#x5C5E;&amp;#x6027;:&amp;#x503C;;&amp;#x5C5E;">
<meta name="twitter:image" content="https://hongqinma.github.io/2013/09/10/CSS样式表、选择器-md/text-base.png">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '6347850919329138000',
      author: 'Hiraku'
    }
  };
</script>




  <link rel="canonical" href="https://hongqinma.github.io/2013/09/10/CSS样式表、选择器-md/"/>


  <title> CSS样式表、CSS选择器 | HongqinMa' Blog </title>
</head>

<body itemscope itemtype="//schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?10010323";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  
    <div class="site-meta-headline">
      <a>
        <img class="custom-logo-image" src="http://ofy7k3v4s.bkt.clouddn.com/photo.jpg"
             alt="HongqinMa' Blog"/>
      </a>
    </div>
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">HongqinMa' Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">Spell at all costs， to rush you in the future。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                CSS样式表、CSS选择器
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2013-09-10T22:12:03+08:00" content="2013-09-10">
              2013-09-10
            </time>
          </span>

          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2013/09/10/CSS样式表、选择器-md/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2013/09/10/CSS样式表、选择器-md/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          
              &nbsp; | &nbsp;
              <span class="page-pv"><i class="fa fa-file-o"></i>
              <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
              </span>
          

          
            <span id="busuanzi_container_page_pv">  <span id="busuanzi_value_page_pv"></span> Views</span>
          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="&#x6837;&#x5F0F;&#x8868;&#x7684;&#x4E66;&#x5199;&#x4F4D;&#x7F6E;"><a href="#&#x6837;&#x5F0F;&#x8868;&#x7684;&#x4E66;&#x5199;&#x4F4D;&#x7F6E;" class="headerlink" title="&#x6837;&#x5F0F;&#x8868;&#x7684;&#x4E66;&#x5199;&#x4F4D;&#x7F6E;"></a>&#x6837;&#x5F0F;&#x8868;&#x7684;&#x4E66;&#x5199;&#x4F4D;&#x7F6E;</h2><p>&#x5199;&#x5728; <code>&lt;head&gt;&lt;/head&gt;</code> &#x4E2D;, &#x6837;&#x5F0F;&#xFF1A;&#x9009;&#x62E9;&#x5668;{&#x5C5E;&#x6027;:&#x503C;;&#x5C5E;&#x6027;:&#x503C;; }</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">&lt;head&gt;</div><div class="line">    &lt;meta charset=&quot;UTF-8&quot;&gt;</div><div class="line">    &lt;title&gt;&#x6837;&#x5F0F;&#x8868;&#x5199;&#x6CD5;&lt;/title&gt;</div><div class="line">    &lt;style type=&quot;texr/css&quot;&gt;</div><div class="line">      &#x6837;&#x5F0F;&#x8868;&#x5185;&#x5BB9;</div><div class="line">    &lt;/style&gt;</div><div class="line">&lt;/head&gt;</div></pre></td></tr></table></figure>
<h3 id="&#x6837;&#x5F0F;&#x8868;&#x7684;&#x5E38;&#x89C1;&#x5C5E;&#x6027;"><a href="#&#x6837;&#x5F0F;&#x8868;&#x7684;&#x5E38;&#x89C1;&#x5C5E;&#x6027;" class="headerlink" title="&#x6837;&#x5F0F;&#x8868;&#x7684;&#x5E38;&#x89C1;&#x5C5E;&#x6027;"></a>&#x6837;&#x5F0F;&#x8868;&#x7684;&#x5E38;&#x89C1;&#x5C5E;&#x6027;</h3><ul>
<li>width  &#x5BBD;&#x5EA6;  width:200px;</li>
<li>height  &#x9AD8;&#x5EA6;  height:200px;</li>
<li>background-color &#x80CC;&#x666F;&#x8272; background-color:red;</li>
<li>font-size  &#x6587;&#x5B57;&#x5927;&#x5C0F; font-size:20px;</li>
<li>color  &#x6587;&#x672C;&#x989C;&#x8272;(&#x524D;&#x666F;&#x8272;)  color:yellow;</li>
<li>text-align  &#x5185;&#x5BB9;&#x7684;&#x6C34;&#x5E73;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;  text-align:left|center|right</li>
<li>text-indent  &#x9996;&#x884C;&#x7F29;&#x8FDB;  text-indent:2em;&#xFF08;2&#x4E2A;&#x6C49;&#x5B57;&#x7684;&#x5927;&#x5C0F;&#xFF09;</li>
</ul>
<h4 id="&#x5E38;&#x89C1;&#x5C5E;&#x6027;&#x8868;&#x683C;"><a href="#&#x5E38;&#x89C1;&#x5C5E;&#x6027;&#x8868;&#x683C;" class="headerlink" title="&#x5E38;&#x89C1;&#x5C5E;&#x6027;&#x8868;&#x683C;"></a>&#x5E38;&#x89C1;&#x5C5E;&#x6027;&#x8868;&#x683C;</h4><table>
<thead>
<tr>
<th>&#x5C5E;&#x6027;</th>
<th>&#x503C;</th>
<th>&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>width</td>
<td>20px</td>
<td>&#x5BBD;</td>
</tr>
<tr>
<td>height</td>
<td>300px</td>
<td>&#x9AD8;</td>
</tr>
<tr>
<td>background-color</td>
<td>red</td>
<td>&#x80CC;&#x666F;&#x8272;</td>
</tr>
<tr>
<td>text-align</td>
<td>left/center/rigtht</td>
<td>&#x5185;&#x5BB9;&#x6C34;&#x5E73;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;</td>
</tr>
<tr>
<td>text-indent</td>
<td>2em/px/%</td>
<td>&#x9996;&#x884C;&#x7F29;&#x8FDB;</td>
</tr>
<tr>
<td>font-size</td>
<td>normal/border</td>
<td>&#x6587;&#x672C;&#x5927;&#x5C0F;</td>
</tr>
<tr>
<td>font-weight</td>
<td>100-900/bold</td>
<td>&#x6587;&#x672C;&#x7C97;&#x7EC6;</td>
</tr>
<tr>
<td>font-style</td>
<td>nomal/italic</td>
<td>&#x6587;&#x672C;&#x98CE;&#x683C;</td>
</tr>
<tr>
<td>font-family</td>
<td>&#x5B8B;&#x4F53;</td>
<td>&#x5B57;&#x4F53;</td>
</tr>
<tr>
<td>line-height</td>
<td>1.5/2em/px/%</td>
<td>&#x884C;&#x9AD8;</td>
</tr>
</tbody>
</table>
<h4 id="&#x884C;&#x9AD8;"><a href="#&#x884C;&#x9AD8;" class="headerlink" title="&#x884C;&#x9AD8;"></a>&#x884C;&#x9AD8;</h4><p>&#x884C;&#x9AD8; &#x6D4F;&#x89C8;&#x5668;&#x9ED8;&#x8BA4;&#x6587;&#x5B57;&#x5927;&#x5C0F; div 1350px*18px </p>
<ul>
<li>&#x884C;&#x9AD8;=&#x6587;&#x672C;+&#x4E0A;&#x8FB9;&#x8DDD;+&#x4E0B;&#x8FB9;&#x8DDD;</li>
<li>&#x9ED8;&#x8BA4;&#x6587;&#x5B57;&#x5927;&#x5C0F;&#x662F;16px</li>
<li>&#x9ED8;&#x8BA4;&#x884C;&#x9AD8;&#x5927;&#x5C0F;&#x662F;18px</li>
</ul>
<p>&#x4E00;&#x884C;&#x6587;&#x5B57;&#xFF0C;&#x884C;&#x9AD8;&#x4E0E;&#x7236;&#x5143;&#x7D20;&#x9AD8;&#x5EA6;&#x4E00;&#x81F4;&#x65F6;&#xFF0C;&#x6587;&#x672C;&#x5782;&#x76F4;&#x5C45;&#x4E2D;&#x5BF9;&#x9F50;&#x3002;</p>
<p>&#x884C;&#x9AD8;&#x7684;&#x5355;&#x4F4D;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">&#x884C;&#x9AD8;&#x503C; &#x6587;&#x5B57;&#x5927;&#x5C0F;  &#x884C;&#x9AD8;&#x5927;&#x5C0F;</div><div class="line">40px   20px      40px</div><div class="line">2em    20px      40px</div><div class="line">150%   20px      30px</div><div class="line">3      20px      60px</div></pre></td></tr></table></figure>
<p>&#x603B;&#x7ED3;&#xFF1A;</p>
<p>&#x5F53;&#x7ED9;&#x7236;&#x5143;&#x7D20;&#x8BBE;&#x7F6E;&#x884C;&#x9AD8;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x9664;&#x4E86;&#x4EE5;px&#x4E3A;&#x5355;&#x4F4D;&#x4EE5;&#x5916;&#xFF0C;&#x5176;&#x4ED6;&#x7684;&#x503C;&#x90FD;&#x4E0E;&#x6587;&#x5B57;&#x5927;&#x5C0F;&#x6709;&#x5173;&#xFF0C;&#x662F;&#x4E0E;&#x6587;&#x5B57;&#x5927;&#x5C0F;&#x7684;&#x4E58;&#x79EF;, &#x884C;&#x9AD8;&#x662F;&#x53EF;&#x4EE5;&#x7EE7;&#x627F;&#x3002;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">&#x7236;&#x5143;&#x7D20;&#x884C;&#x9AD8; &#x7236;&#x5143;&#x7D20;&#x6587;&#x5B57;&#x5927;&#x5C0F; &#x5B50;&#x5143;&#x7D20;&#x6587;&#x5B57;&#x5927;&#x5C0F; &#x5B50;&#x5143;&#x7D20;&#x884C;&#x9AD8;</div><div class="line">40px       20px           30px            40px</div><div class="line">2em        20px           30px            40px</div><div class="line">150%       20px           30px            30px</div><div class="line">3          20px           30px            90px</div></pre></td></tr></table></figure>
<h4 id="&#x6587;&#x672C;&#x57FA;&#x7EBF;"><a href="#&#x6587;&#x672C;&#x57FA;&#x7EBF;" class="headerlink" title="&#x6587;&#x672C;&#x57FA;&#x7EBF;"></a>&#x6587;&#x672C;&#x57FA;&#x7EBF;</h4><p><img src="/2013/09/10/CSS&#x6837;&#x5F0F;&#x8868;&#x3001;&#x9009;&#x62E9;&#x5668;-md/text-base.png" alt="&#x6587;&#x672C;&#x57FA;&#x7EBF;"></p>
<h2 id="&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;"><a href="#&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;"></a>&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;</h2><h3 id="&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;"><a href="#&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;"></a>&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;</h3><ul>
<li>&#x5199;&#x6CD5;&#xFF1A;&#x6807;&#x7B7E;{&#x5C5E;&#x6027;&#x503C;;}</li>
<li>&#x7279;&#x70B9;&#xFF1A;&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;&#x5B9A;&#x4E49;&#x4E4B;&#x540E;&#xFF0C;&#x4F1A;&#x5C06;&#x9875;&#x9762;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;&#x90FD;&#x6267;&#x884C;&#x8FD9;&#x4E2A;&#x6837;&#x5F0F;</li>
</ul>
<p>&#x989C;&#x8272;&#x7684;&#x663E;&#x793A;&#x65B9;&#x5F0F;&#xFF1A;</p>
<ul>
<li>&#x76F4;&#x63A5;&#x5199;&#x989C;&#x8272;&#x540D;&#x79F0;&#xFF1A; &#x5982;&#xFF1A; &#x201C;red&#x201D;&#xFF1B;</li>
<li>16&#x8FDB;&#x5236;&#x663E;&#x793A; &#x7531;0-9&#x548C;a-ff&#x4E00;&#x5171;16&#x4E2A;&#x503C;&#x7EC4;&#x6210;&#xFF1B;#ff0000;<ul>
<li>#ff0000,&#x524D;&#x8FB9;2&#x4E2A;&#x6570;&#x503C;&#x5BF9;&#x5E94;&#x7684;&#x662F;&#x7EA2;&#x8272;&#xFF0C;#00ff00,&#x4E2D;&#x95F4;2&#x4E2A;&#x5BF9;&#x5E94;&#x7684;&#x662F;&#x7EFF;&#x8272;&#xFF0C;#0000ff,&#x540E;&#x8FB9;2&#x4E2A;&#x5BF9;&#x5E94;&#x7684;&#x662F;&#x84DD;&#x8272;&#x3002;</li>
</ul>
</li>
<li>RGB&#x8868;&#x793A;&#x989C;&#x8272;<ul>
<li>&#x5982;&#xFF1A;span{color: rgb(23,23,23); } </li>
<li>r&#x4EE3;&#x8868;&#x7EA2;&#x8272;&#xFF0C;g&#x7EFF;&#x8272; b&#x84DD;&#x8272;</li>
</ul>
</li>
<li>rgba &#x8868;&#x793A;&#x4E0D;&#x900F;&#x660E;&#x5EA6;<ul>
<li>&#x5982;&#xFF1A;h1{width: 500px; height: 400px; color: rgba(121,232,108,0.5); }</li>
<li>a&#x4EE3;&#x6807;alpha 0-1;</li>
</ul>
</li>
</ul>
<h3 id="&#x7C7B;&#x9009;&#x62E9;&#x5668;"><a href="#&#x7C7B;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x7C7B;&#x9009;&#x62E9;&#x5668;"></a>&#x7C7B;&#x9009;&#x62E9;&#x5668;</h3><ul>
<li>&#x5199;&#x6CD5;&#xFF1A;&#x81EA;&#x5B9A;&#x4E49;&#x7C7B;&#x540D;{&#x5C5E;&#x6027;:&#x503C;;}</li>
<li>&#x7279;&#x70B9;&#xFF1A;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x9700;&#x8981;&#x8C03;&#x7528;&#x624D;&#x80FD;&#x751F;&#x6548;&#xFF0C;&#x8C01;&#x8C03;&#x7528;&#x8C01;&#x751F;&#x6548;</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">.box{width: 200px; height: 40px; color: yellow; background-color: rgb(24,124,101); text-align: center; font-size: 24px; }</div></pre></td></tr></table></figure>
<p>&#x591A;&#x6807;&#x7B7E;&#x53EF;&#x4EE5;&#x8C03;&#x7528;&#x540C;&#x4E00;&#x4E2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">&lt;div class=&quot;box baby&quot;&gt;&#x52A0;&#x6CB9;&#x52AA;&#x529B;&#x594B;&#x6597;&lt;/div&gt;</div></pre></td></tr></table></figure>
<p>&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x7684;&#x547D;&#x540D;&#x89C4;&#x5219;</p>
<ul>
<li>&#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x7EAF;&#x6570;&#x5B57;&#x548C;&#x7EAF;&#x6570;&#x5B57;&#x5F00;&#x5934;&#x6765;&#x5B9A;&#x4E49;&#x7C7B;&#x540D;</li>
<li>&#x4E0D;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;&#x4E2D;&#x6587;</li>
<li>&#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x7279;&#x6B8A;&#x7B26;&#x53F7;&#x6765;&#x5B9A;&#x4E49;&#x7C7B;&#x540D;&#xFF08;&#x201C;_&#x201D;&#x9664;&#x5916;&#xFF09;</li>
<li>&#x4E0D;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;&#x6807;&#x7B7E;&#x540D;&#x548C;&#x5C5E;&#x6027;&#x540D;&#x6765;&#x5B9A;&#x4E49;&#x7C7B;&#x540D;</li>
</ul>
<h3 id="id&#x9009;&#x62E9;&#x5668;"><a href="#id&#x9009;&#x62E9;&#x5668;" class="headerlink" title="id&#x9009;&#x62E9;&#x5668;"></a>id&#x9009;&#x62E9;&#x5668;</h3><ul>
<li>&#x5199;&#x6CD5;&#xFF1A; #&#x540D;&#x79F0;{&#x5C5E;&#x6027;:&#x503C;}</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">#box{width: 300px; height: 200px; background-color: pink; font-size: 20px; }</div></pre></td></tr></table></figure>
<ul>
<li>&#x7279;&#x70B9;: id&#x9009;&#x62E9;&#x5668;&#x9700;&#x8981;&#x8C03;&#x7528;&#x624D;&#x80FD;&#x751F;&#x6548;&#xFF0C;&#x8C01;&#x8C03;&#x7528;&#x8C01;&#x751F;&#x6548;<ul>
<li>&#x4E00;&#x4E2A;&#x6807;&#x7B7E;&#x4E0D;&#x80FD;&#x8C03;&#x7528;&#x591A;&#x4E2A;ID&#x9009;&#x62E9;&#x5668;</li>
<li>&#x4E00;&#x4E2A;id&#x9009;&#x62E9;&#x5668;&#x5728;&#x4E00;&#x4E2A;&#x9875;&#x9762;&#x5185;&#x53EA;&#x80FD;&#x8C03;&#x7528;&#x4E00;&#x6B21;&#xFF0C;&#x591A;&#x6B21;&#x8C03;&#x7528;&#x4E0D;&#x7B26;&#x5408;w3c&#x89C4;&#x8303;&#xFF0C;&#x914D;&#x5408;js&#x4F7F;&#x7528;&#xFF0C;&#x82E5;&#x51FA;&#x73B0;&#x591A;&#x6B21;js&#x8C03;&#x7528;&#x5219;&#x4F1A;&#x51FA;&#x9519;&#xFF0C;</li>
</ul>
</li>
</ul>
<h3 id="&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;"><a href="#&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;"></a>&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;</h3><ul>
<li>&#x5199;&#x6CD5;&#xFF1A;*{&#x5C5E;&#x6027;:&#x503C;;}</li>
<li>&#x7279;&#x70B9;&#xFF1A;<ul>
<li>&#x6D4F;&#x89C8;&#x5668;&#x7D2F;&#x6B7B;&#x4E86;&#xFF0C;&#x6D88;&#x8017;&#x670D;&#x52A1;&#x5668;&#x8D44;&#x6E90;&#xFF0C;&#x4E0D;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#xFF1B;</li>
<li>&#x4F1A;&#x5C06;&#x6240;&#x6709;&#x7684;&#x6807;&#x7B7E;&#x90FD;&#x6267;&#x884C;&#x8FD9;&#x4E2A;&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;</li>
</ul>
</li>
</ul>
<h2 id="&#x6587;&#x672C;&#x4ECB;&#x7ECD;"><a href="#&#x6587;&#x672C;&#x4ECB;&#x7ECD;" class="headerlink" title="&#x6587;&#x672C;&#x4ECB;&#x7ECD;"></a>&#x6587;&#x672C;&#x4ECB;&#x7ECD;</h2><h3 id="&#x6587;&#x672C;&#x5C5E;&#x6027;"><a href="#&#x6587;&#x672C;&#x5C5E;&#x6027;" class="headerlink" title="&#x6587;&#x672C;&#x5C5E;&#x6027;"></a>&#x6587;&#x672C;&#x5C5E;&#x6027;</h3><ul>
<li>&#x6587;&#x672C;&#x5C5E;&#x6027;<ul>
<li>font-size &#x6587;&#x5B57;&#x5927;&#x5C0F;</li>
<li>font-weight &#x6587;&#x5B57;&#x7684;&#x7C97;&#x7EC6;  &#x503C;&#x4ECE;100-900; 700&#x7684;&#x503C;&#x548C;bold&#x5927;&#x7EA6;&#x4E00;&#x6837;(&#x7528;700,&#x4E0D;&#x7528;bold)</li>
<li>font-style &#x6587;&#x672C;&#x98CE;&#x683C;&#xFF1A; nomarl |italic</li>
<li>font-family  &#x5B57;&#x4F53;&#xFF1A;&#x5B8B;&#x4F53;&#xFF0C;&#x5FAE;&#x8F6F;&#x96C5;&#x9ED1;&#xFF0C;&#x6977;&#x4F53;</li>
<li>line-height &#x884C;&#x9AD8; </li>
</ul>
</li>
</ul>
<h3 id="&#x6587;&#x672C;&#x5C5E;&#x6027;&#x8FDE;&#x5199;"><a href="#&#x6587;&#x672C;&#x5C5E;&#x6027;&#x8FDE;&#x5199;" class="headerlink" title="&#x6587;&#x672C;&#x5C5E;&#x6027;&#x8FDE;&#x5199;"></a>&#x6587;&#x672C;&#x5C5E;&#x6027;&#x8FDE;&#x5199;</h3><p>&#x987A;&#x5E8F;&#xFF1A; <code>font: font-style font-weigtht font-size/line-height font-family</code></p>
<p>&#x6CE8;&#xFF1A;&#x6309;&#x7167;&#x987A;&#x5E8F;&#x5199;&#xFF0C;&#x6587;&#x5B57;&#x5927;&#x5C0F;&#x548C;&#x5B57;&#x4F53;&#x5728;&#x6587;&#x5B57;&#x8FDE;&#x5199;&#x7684;&#x65F6;&#x5019;&#x4E3A;&#x5FC5;&#x987B;&#x5199;&#x7684;&#x5C5E;&#x6027;&#xFF1B;</p>
<h3 id="&#x5B57;&#x4F53;&#x7684;&#x8868;&#x8FBE;&#x65B9;&#x5F0F;"><a href="#&#x5B57;&#x4F53;&#x7684;&#x8868;&#x8FBE;&#x65B9;&#x5F0F;" class="headerlink" title="&#x5B57;&#x4F53;&#x7684;&#x8868;&#x8FBE;&#x65B9;&#x5F0F;"></a>&#x5B57;&#x4F53;&#x7684;&#x8868;&#x8FBE;&#x65B9;&#x5F0F;</h3><ul>
<li>&#x76F4;&#x63A5;&#x5199;&#x4E2D;&#x6587;&#x5B57;&#x4F53;&#xFF08;&#x5B8B;&#x4F53;|&#x5FAE;&#x8F6F;&#x96C5;&#x9ED1;&#xFF09;</li>
<li>&#x76F4;&#x63A5;&#x5199;&#x5B57;&#x4F53;&#x7684;&#x82F1;&#x6587;&#x540D;&#x5B57;&#xFF08;simsun|microsoft yahei|&#xFF09;</li>
<li>Unicode&#x7F16;&#x7801;&#x65B9;&#x5F0F;<ul>
<li>&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x4E2D;&#x67E5;&#x627E;Unicode&#x7F16;&#x7801;</li>
<li>chrome&#x2013;&gt;f12&#x2013;&gt;console&#x2013;&gt;escape(&#x201C;&#x5B8B;&#x4F53;&#x201D;)&#x2013;&gt;enter</li>
</ul>
</li>
</ul>
<h3 id="&#x590D;&#x5408;&#x62E9;&#x5668;"><a href="#&#x590D;&#x5408;&#x62E9;&#x5668;" class="headerlink" title="&#x590D;&#x5408;&#x62E9;&#x5668;"></a>&#x590D;&#x5408;&#x62E9;&#x5668;</h3><p>&#x4E24;&#x4E2A;&#x6216;&#x4E24;&#x4E2A;&#x4EE5;&#x4E0A;&#x7684;&#x9009;&#x62E9;&#x5668;&#x901A;&#x8FC7;&#x4E0D;&#x540C;&#x7684;&#x65B9;&#x5F0F;&#x8FDE;&#x63A5;&#x5230;&#x4E00;&#x8D77;</p>
<h4 id="&#x4EA4;&#x96C6;&#x9009;&#x62E9;&#x5668;"><a href="#&#x4EA4;&#x96C6;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x4EA4;&#x96C6;&#x9009;&#x62E9;&#x5668;"></a>&#x4EA4;&#x96C6;&#x9009;&#x62E9;&#x5668;</h4><ul>
<li>&#x5199;&#x6CD5; <code>&#x6807;&#x7B7E;+&#x7C7B;(id){&#x5C5E;&#x6027;:&#x503C;}</code></li>
<li>&#x7279;&#x70B9;&#xFF1A;&#x65E2;&#x2026;&#x53C8;&#x7684;&#x5173;&#x7CFB;</li>
</ul>
<h4 id="&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;"><a href="#&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;"></a>&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;</h4><ul>
<li>&#x5199;&#x6CD5;&#xFF1A; <code>&#x9009;&#x62E9;&#x5668;+&#x7A7A;&#x683C;+&#x9009;&#x62E9;&#x5668;+&#x7A7A;&#x683C;+&#x9009;&#x62E9;&#x5668;{&#x5C5E;&#x6027;:&#x503C;;}</code></li>
<li>&#x6CE8;&#x610F;&#xFF1A;&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;&#x9996;&#x5148;&#x8981;&#x6EE1;&#x8DB3;&#x5305;&#x542B;&#xFF08;&#x5D4C;&#x5957;&#x5173;&#x7CFB;&#xFF09;&#x3002;</li>
<li>&#x7279;&#x70B9;&#xFF1A;<ul>
<li>&#x53EF;&#x4EE5;&#x65E0;&#x9650;&#x5236;&#x9694;&#x4EE3;&#x3002;</li>
<li>&#x53EA;&#x8981;&#x80FD;&#x4EE3;&#x8868;&#x7236;&#x5B50;&#x5173;&#x7CFB;&#xFF0C;&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;&#x3001;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x3001;id&#x9009;&#x62E9;&#x5668;&#x53EF;&#x4EE5;&#x4EFB;&#x610F;&#x7EC4;&#x5408;</li>
<li>&#x7236;&#x7EA7;&#x5143;&#x7D20;&#x5728;&#x524D;&#x9762;&#xFF0C;&#x5B50;&#x7EA7;&#x5143;&#x7D20;&#x5728;&#x540E;&#x9762;</li>
</ul>
</li>
</ul>
<h4 id="&#x5B50;&#x4EE3;&#x9009;&#x62E9;&#x5668;"><a href="#&#x5B50;&#x4EE3;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x5B50;&#x4EE3;&#x9009;&#x62E9;&#x5668;"></a>&#x5B50;&#x4EE3;&#x9009;&#x62E9;&#x5668;</h4><ul>
<li>&#x5199;&#x6CD5;&#xFF1A;&#x9009;&#x62E9;&#x5668;&gt;&#x9009;&#x62E9;&#x5668;{&#x5C5E;&#x6027;:&#x503C;;}</li>
<li>&#x7279;&#x70B9;&#xFF1A;&#x9009;&#x4E2D;&#x7684;&#x662F;&#x76F4;&#x63A5;&#x4E0B;&#x4E00;&#x7EA7;</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line">&lt;style type=&quot;text/css&quot;&gt;</div><div class="line">    div&gt;span{</div><div class="line">      color: red;</div><div class="line">      font-size: 36px;}</div><div class="line">&lt;/style&gt;</div><div class="line">&lt;div&gt;</div><div class="line">    &lt;p&gt;</div><div class="line">      &lt;span&gt;</div><div class="line">        &#x613F;&#x4F7F;&#x5C81;&#x6708;&#x9759;&#x597D;&#xFF0C;&#x73B0;&#x4E16;&#x5B89;&#x7A33;&#x3002;</div><div class="line">      &lt;/span&gt;</div><div class="line">    &lt;/p&gt;</div><div class="line">    &lt;span&gt;&#x5929;&#x624D;&#x5728;&#x5DE6;&#x75AF;&#x5B50;&#x5728;&#x53F3;&lt;/span&gt;</div><div class="line">&lt;/div&gt;</div></pre></td></tr></table></figure>
<h4 id="&#x5E76;&#x96C6;&#x9009;&#x62E9;&#x5668;"><a href="#&#x5E76;&#x96C6;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x5E76;&#x96C6;&#x9009;&#x62E9;&#x5668;"></a>&#x5E76;&#x96C6;&#x9009;&#x62E9;&#x5668;</h4><p>&#x5C06;&#x4E0D;&#x540C;&#x9009;&#x62E9;&#x5668;&#x4E4B;&#x95F4;&#x76F8;&#x540C;&#x7684;&#x6837;&#x5F0F;&#x5199;&#x5728;&#x4E00;&#x8D77;&#xFF0C;&#x9009;&#x62E9;&#x5668;&#x4E4B;&#x95F4;&#x901A;&#x8FC7;&#x9017;&#x53F7;&#x94FE;&#x63A5;&#x5728;&#x4E00;&#x8D77;&#x3002;</p>
<ul>
<li>&#x53EF;&#x80FD;&#x662F;&#x5305;&#x542B;&#x5173;&#x7CFB;&#xFF0C;&#x4E5F;&#x53EF;&#x80FD;&#x662F;&#x5E76;&#x5217;&#x5173;&#x7CFB;&#x3002;</li>
<li>&#x5982;&#x679C;&#x6807;&#x7B7E;&#x6837;&#x5F0F;&#x76F8;&#x540C;&#x6216;&#x8005;&#x90E8;&#x5206;&#x76F8;&#x540C;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x5E76;&#x96C6;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x901A;&#x8FC7;&#x9017;&#x53F7;&#x8FDE;&#x63A5;&#x5728;&#x4E00;&#x8D77;</li>
<li>&#x9009;&#x62E9;&#x5668;+,+&#x9009;&#x62E9;&#x5668;{&#x5C5E;&#x6027;:&#x503C;;}</li>
<li>&#x7279;&#x70B9;&#xFF1A;&#x5E76;&#x96C6;&#x9009;&#x62E9;&#x5668;&#x4E0D;&#x4E00;&#x5B9A;&#x662F;&#x5E76;&#x5217;&#x5173;&#x7CFB;</li>
<li>&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;&#x3001;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x3001;id&#x9009;&#x62E9;&#x5668;&#x3001;&#x590D;&#x5408;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x9017;&#x53F7;&#x4EFB;&#x610F;&#x7EC4;&#x5408;&#x8FDE;&#x63A5;&#x5728;&#x4E00;&#x8D77;</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">.one,.one .two, .three, p{font-size: 50px; font-weight: normal; }</div><div class="line">&lt;div class=&quot;one&quot;&gt;</div><div class="line">&lt;h1 class=&quot;two&quot;&gt;&#x660E;&#x5A9A;&#x7684;&#x5FC3;&lt;/h1&gt;</div><div class="line">&lt;/div&gt;</div><div class="line">&lt;p&gt;&#x5929;&#x624D;&#xFF0C;&#x548C;&#x8822;&#x6750;&#x7684;&#x5DEE;&#x522B;&#x662F;&#x52E4;&#x594B;&lt;/p&gt;</div><div class="line">&lt;div class=&quot;three&quot;&gt;&#x7F8E;&#x4E3D;&#x7684;&#x4EBA;&#x751F;&#x8981;&#x9760;&#x52AA;&#x529B;&lt;/div&gt;</div></pre></td></tr></table></figure>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>感谢您的支持！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>打 赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="http://ofy7k3v4s.bkt.clouddn.com/wcpayCode.jpg" alt="Hongqin Ma WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="http://ofy7k3v4s.bkt.clouddn.com/apayCode.jpg" alt="Hongqin Ma Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/CSS/" rel="tag">#CSS</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2013/09/05/HTML表格、表单、标签语义化/" rel="next" title="HTML表格、表单、标签语义化">
                <i class="fa fa-chevron-left"></i> HTML表格、表单、标签语义化
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2013/09/17/HTML元素分类、伪类、背景图片/" rel="prev" title="HTML元素分类、伪类、背景图片">
                HTML元素分类、伪类、背景图片 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2013/09/10/CSS样式表、选择器-md/"
     data-title="CSS样式表、CSS选择器"
     data-content=""
     data-url="https://hongqinma.github.io/2013/09/10/CSS样式表、选择器-md/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2013/09/10/CSS样式表、选择器-md/"
           data-title="CSS样式表、CSS选择器" data-url="https://hongqinma.github.io/2013/09/10/CSS样式表、选择器-md/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/photo.jpg"
               alt="Hongqin Ma" />
          <p class="site-author-name" itemprop="name">Hongqin Ma</p>
          <p class="site-description motion-element" itemprop="description">Spell at all costs， to rush you in the future. </p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">68</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">16</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">57</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/HongqinMa" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/HongqinMa" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/profile.php?id=100006581058735" target="_blank" title="Facebook">
                  
                    <i class="fa fa-fw fa-facebook"></i>
                  
                  Facebook
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/HirakuMa" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-share-alt"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/rubylouvre/" title="司徒正美" target="_blank">司徒正美</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/sanshi/" title="三生石上" target="_blank">三生石上</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/TomXu/" title="汤姆大叔" target="_blank">汤姆大叔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://gold.xitu.io/" title="掘金" target="_blank">掘金</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://segmentfault.com/" title="segmentfault" target="_blank">segmentfault</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles" title="简书" target="_blank">简书</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://home.cnblogs.com/" title="博客园" target="_blank">博客园</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.awesomes.cn/" title="Awesomes" target="_blank">Awesomes</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#样式表的书写位置"><span class="nav-number">1.</span> <span class="nav-text">样式表的书写位置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#样式表的常见属性"><span class="nav-number">1.1.</span> <span class="nav-text">样式表的常见属性</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#常见属性表格"><span class="nav-number">1.1.1.</span> <span class="nav-text">常见属性表格</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#行高"><span class="nav-number">1.1.2.</span> <span class="nav-text">行高</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#文本基线"><span class="nav-number">1.1.3.</span> <span class="nav-text">文本基线</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#基础选择器"><span class="nav-number">2.</span> <span class="nav-text">基础选择器</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#标签选择器"><span class="nav-number">2.1.</span> <span class="nav-text">标签选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#类选择器"><span class="nav-number">2.2.</span> <span class="nav-text">类选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#id选择器"><span class="nav-number">2.3.</span> <span class="nav-text">id选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#通配符选择器"><span class="nav-number">2.4.</span> <span class="nav-text">通配符选择器</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#文本介绍"><span class="nav-number">3.</span> <span class="nav-text">文本介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#文本属性"><span class="nav-number">3.1.</span> <span class="nav-text">文本属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文本属性连写"><span class="nav-number">3.2.</span> <span class="nav-text">文本属性连写</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#字体的表达方式"><span class="nav-number">3.3.</span> <span class="nav-text">字体的表达方式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#复合择器"><span class="nav-number">3.4.</span> <span class="nav-text">复合择器</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#交集选择器"><span class="nav-number">3.4.1.</span> <span class="nav-text">交集选择器</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#后代选择器"><span class="nav-number">3.4.2.</span> <span class="nav-text">后代选择器</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#子代选择器"><span class="nav-number">3.4.3.</span> <span class="nav-text">子代选择器</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#并集选择器"><span class="nav-number">3.4.4.</span> <span class="nav-text">并集选择器</span></a></li></ol></li></ol></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hongqin Ma</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Page Views: <span id="busuanzi_value_site_pv"></span> 
</span>

        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span>
  

  
    <span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"Hiraku"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
<script>
function showTime(Counter) {
  var query = new AV.Query(Counter);
  $(".leancloud_visitors").each(function() {
    var url = $(this).attr("id").trim();
    query.equalTo("url", url);
    query.find({
      success: function(results) {
        if (results.length == 0) {
          var content = '0 ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
          return;
        }
        for (var i = 0; i < results.length; i++) {
          var object = results[i];
          var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
        }
      },
      error: function(object, error) {
        console.log("Error: " + error.code + " " + error.message);
      }
    });

  });
}

function addCount(Counter) {
  var Counter = AV.Object.extend("Counter");
  url = $(".leancloud_visitors").attr('id').trim();
  title = $(".leancloud_visitors").attr('data-flag-title').trim();
  var query = new AV.Query(Counter);
  query.equalTo("url", url);
  query.find({
    success: function(results) {
      if (results.length > 0) {
        var counter = results[0];
        counter.fetchWhenSave(true);
        counter.increment("time");
        counter.save(null, {
          success: function(counter) {
            var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(counter, error) {
            console.log('Failed to save Visitor num, with error message: ' + error.message);
          }
        });
      } else {
        var newcounter = new Counter();
        newcounter.set("title", title);
        newcounter.set("url", url);
        newcounter.set("time", 1);
        newcounter.save(null, {
          success: function(newcounter) {
              console.log("newcounter.get('time')="+newcounter.get('time'));
            var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(newcounter, error) {
            console.log('Failed to create');
          }
        });
      }
    },
    error: function(error) {
      console.log('Error:' + error.code + " " + error.message);
    }
  });
}
$(function() {
  var Counter = AV.Object.extend("Counter");
  if ($('.leancloud_visitors').length == 1) {
    addCount(Counter);
  } else if ($('.post-title-link').length > 1) {
    showTime(Counter);
  }
}); 
</script>

  
</body>
</html>
